package com.movitech.mobile.cz.base.purchase.service;

import com.baomidou.mybatisplus.service.IService;
import com.movitech.mobile.cz.base.common.util.PageCode;
import com.movitech.mobile.cz.base.modules.controller.RestReturnResult;
import com.movitech.mobile.cz.base.purchase.bizvo.PContactPlanVo;
import com.movitech.mobile.cz.base.purchase.entity.PContactPlan;
import com.movitech.mobile.cz.base.purchase.entity.ext.ExtPContactPlan;
import com.movitech.mobile.cz.base.purchase.entity.ext.PContactPlanFindRequest;
import com.movitech.mobile.cz.base.purchase.entity.ext.PContactPlanGetRequest;

import java.util.List;

/**
 * <p>
 * 合约规划 服务类
 * </p>
 *
 * @author Movitech Mobile
 * @since 2018-03-08
 */
public interface PContactPlanService extends IService<PContactPlan> {

    PageCode findContractPlanList(PContactPlanFindRequest pContactPlanFindRequest) throws Exception;

    ExtPContactPlan getPContractPlanById(String contractPlanId);

    Double getBudgetByContractId(String contractId);

    boolean insertOrUpdateSpecialPurchasePlan(PContactPlan contactPlan);

    RestReturnResult getPContractPlanByIds(PContactPlanGetRequest pContactPlanGetRequest);

    /**
     * 添加合约规划
     *
     * @param pContactPlan
     * @return
     */
    boolean addPContactPlan(PContactPlan pContactPlan);

    /**
     * 更新合约规划
     *
     * @param pContactPlan
     * @return
     */
    boolean updatePContactPlan(PContactPlan pContactPlan);

    void batchSave(List<PContactPlanVo> pContactPlan);

    /**
     * 获取项目分期列表
     *
     * @return
     * @throws Exception
     */
    RestReturnResult getProjectPhasesList() throws Exception;

    /***
     * 从成本系统中同步合约规划
     * @param lstPContactPlanVo
     * @return
     */
    RestReturnResult doSynContactPlanFromCostSystem(List<PContactPlanVo> lstPContactPlanVo);

    List<ExtPContactPlan> selectByDetailId(String id);

    public void saveOrUpdatePContactPlan(PContactPlanVo item);

}
